//
//  VailtalView.m
//  Village
//
//  Created by longrise on 2017/9/7.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "VailtalView.h"

@implementation VailtalView

- (instancetype)initWithFrame:(CGRect)frame{
    self=[super initWithFrame:frame];
    if (self) {
    }
    
    UIImageView *image = [[UIImageView alloc] init];
    image.image = [UIImage imageNamed:@"kong_village"];
    [self addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(40*kScreenScaleX);//使顶部与self.ScrollWebView的底部间距为0
        make.width.mas_equalTo(150*kScreenScaleX);;
        make.height.mas_equalTo(150*kScreenScaleY);
        make.centerX.equalTo(self);
    }];
    
    UILabel *vaillable = [[UILabel alloc] init];
    vaillable.text = @"您尚未绑定村落信息~";
    vaillable.textColor = [Util colorWithHexString:@"999999"];
    [vaillable setTextAlignment : NSTextAlignmentCenter];
    vaillable.font = [UIFont systemFontOfSize:14*kScreenScaleX];
    [self addSubview:vaillable];
    [vaillable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(image.mas_bottom).offset(24*kScreenScaleX);//使顶部与self.ScrollWebView的底部间距为0
        make.width.mas_equalTo(200*kScreenScaleX);;
        make.height.mas_equalTo(13*kScreenScaleY);
        make.centerX.equalTo(self);
    }];
    
    _button = [[UIButton alloc] init];
//    [_button setBackgroundImage:[UIImage imageNamed:@"BG"] forState:UIControlStateNormal];
    _button.backgroundColor = K_Zitihong;
    _button.layer.cornerRadius=5.0f*kScreenScaleX;// 将图层的边框设置为圆角
    _button.layer.masksToBounds=YES;// 隐藏边界
    [_button setTitle:@"绑定我的村落" forState:UIControlStateNormal];
    
    [self addSubview:_button];
    [_button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(vaillable.mas_bottom).offset(56*kScreenScaleX);//使顶部与self.ScrollWebView的底部间距为0
        make.width.mas_equalTo(170*kScreenScaleX);;
        make.height.mas_equalTo(45*kScreenScaleY);
        make.centerX.equalTo(self);
    }];
    
    {
        return self;
    }
    
    
    
}

@end
